/**
 * @Author: oldTea
 * @CreateTime: 2024-09-23
 * @Description: id转换器
 * @Version: 1.0
 */
package com.ambition.demo.developUtils;

import java.io.*;

/**
 * @Author: oldTea
 * @CreateTime: 2024-09-23
 * @Description: id转换器
 * @Version: 1.0
 */
public class IdConvert {

    public static String to36Id(String id) {

        return id.substring(0, 8) + "-" +
                id.substring(8, 12) + "-" +
                id.substring(12, 16) + "-" +
                id.substring(16, 20) + "-" +
                id.substring(20);

    }

    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = null;
        BufferedWriter writer = null;
        try{
             bufferedReader = new BufferedReader(new FileReader("F:\\desk\\aa.txt"));
             writer = new BufferedWriter(new FileWriter("F:\\desk\\bb.txt",true));
            String line;
            while((line = bufferedReader.readLine()) != null){
                String convertedId = IdConvert.to36Id(line);
                writer.write(convertedId);
                writer.newLine();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            bufferedReader.close();
            writer.close();
        }

    }
}


